<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>onmousedown</title>
</head>

<body>
    <div onmousedown="mDown(this)" onmouseup="mUp(this)" style="background-color:green;color:#ffffff;width:90px;height:20px;padding:40px;font-size:12px;">请点击这里
    </div>
    <script>
    	function mDown(obj) {
    		obj.style.backgroundColor = "#34D4D9";
    		obj.innerHTML = "请释放鼠标按钮"
    	}

    	function mUp(obj) {
    		obj.style.backgroundColor = "green";
    		obj.innerHTML = "文字再次变回按下鼠标按钮"
    	}
    </script>
</body>

</html>